<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>沈阳市统一电子票券系统</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <meta name="description" content="沈阳市统一电子票券系统" />
    <meta name="keywords" content="沈阳市统一电子票券系统" />
    <meta content="dlq" name="author" />
    <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script> -->
    <!-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> -->
    <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.16.0/jquery.validate.min.js"></script>
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.16.0/additional-methods.min.js"></script> -->
    <!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" /> -->
    <script src="https://cdn.bootcss.com/jquery/2.2.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery-validate/1.16.0/jquery.validate.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery-validate/1.16.0/additional-methods.min.js"></script>
    <link rel="stylesheet" href="https://cdn.bootcss.com/twitter-bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" />
    <link href="./app/05login/css/login.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="favicon.ico" />

</head>

<body class="login">
    <!-- BEGIN : LOGIN PAGE 5-1 -->
    <div class="user-login-5">
        <div class="tsv_html row bs-reset">
            <div class="col-md-6 bs-reset" >
                <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                  <!-- Wrapper for slides -->
                  <div class="carousel-inner" role="listbox">
                    <div class="item active login-bg skcy" style="background-image:url(./app/00pageframework/img/myqybg.png)"></div>
                    <div class="item active login-bg sst" style="background-image:url(./app/00pageframework/img/sstBg.png)"></div>
                    <div class="item active login-bg syzhly" style="background-image:url(./app/00pageframework/img/syzhly.jpeg)"></div>
                    <div class="item active login-bg hldwt" style="background-image:url(./app/00pageframework/img/hldwt.jpg)"></div>
                    <!-- <div class="item active login-bg" style="background-image:url(./app/00pageframework/img/tp1.jpg)"></div>
                    <div class="item login-bg" style="background-image:url(./app/00pageframework/img/tp2.jpg)"></div>
                    <div class="item login-bg" style="background-image:url(./app/00pageframework/img/tp1.jpg)"></div>
                    <div class="item login-bg" style="background-image:url(./app/00pageframework/img/tp2.jpg)"></div> -->
                  </div>
                </div>
            </div>
            <div class="col-md-6 login-container bs-reset">
                <div class="login-content">
                    <h1>欢迎登陆</h1>
                    <!-- <p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;居游是深度体验游的一种形式， 追求自由、自在、悠闲、舒适的慢养生活。不像旅游团来去匆匆，走马观花，浮光掠影，自由度低，体验度少。 </p> -->
                    <!-- <p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;统一采购  抱团营销  规范价格  提升服务 </p> -->
                    <form action="javascript:;" class="login-form" method="post">
                        <!-- <div class="alert alert-danger display-hide">
                            <button class="close" data-close="alert"></button>
                            <span>Enter any username and password. </span>
                        </div> -->
                        <div class="row">
                            <div class="col-xs-6">
                                <input class="form-control form-control-solid placeholder-no-fix form-group" type="text" autocomplete="off" placeholder="用户名" name="username" id="username" required/> </div>
                            <div class="col-xs-6">
                                <input class="form-control form-control-solid placeholder-no-fix form-group" type="password" autocomplete="off" placeholder="密码" name="password" id="password" required/> </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-4">
                                <div class="rem-password">
                                    <label class="rememberme mt-checkbox mt-checkbox-outline">
                                        <input type="checkbox" name="remember" value="1" /> 记住我
                                        <span></span>
                                    </label>
                                </div>
                            </div>
                            <div class="col-sm-8 text-right">
                                <div class="forgot-password">
                                    <a href="javascript:;" id="forget-password" class="forget-password">忘记密码?</a>
                                </div>
                                <button class="btn green" type="submit">登陆</button>
                                <button type="button" id="register" class="btn btn-success btn-outline">注册</button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="login-footer">
                    <div class="row bs-reset">
                        <div class="col-xs-5 bs-reset">
                            <ul class="login-social">
                                <li>
                                    <a href="javascript:;">
                                        <i class="icon-social-facebook"></i>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:;">
                                        <i class="icon-social-twitter"></i>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:;">
                                        <i class="icon-social-dribbble"></i>
                                    </a>
                                </li>
                            </ul>
                        </div>
                        <div class="col-xs-7 bs-reset">
                            <div class="login-copyright text-right">
                                <!-- <p>Copyright &copy; 2017</p> -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="information_html">
            <span class="heading">沈阳市信息中心专家评审平台</span>
            <form action="javascript:;" class="login-form" method="post">
                <div class="form-group" style="padding: 0 50px;">
                    <div class="input-group">
                        <div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div>
                        <input type="text" class="form-control" placeholder="请输入账号" name="username" id="username1">
                    </div>
                </div>
                <div class="form-group" style="padding: 0 50px;">
                    <div class="input-group">
                        <div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
                        <input type="password" class="form-control" placeholder="请输入密码" name="password" id="password1">
                    </div>
                </div>
                <button type="submit" class="btn btn-lg green btn-login">登  录</button>
            </form>
        </div>
        <div class="ticket_html">
            <span class="heading">欢迎登录</span>
            <form class="login-form" action="javascript:;" method="post">
                <div class="form-group" style="padding: 10px 30px 20px;">
                    <div class="input-group">
                        <div class="input-group-addon ticket_input_addon"><span class="glyphicon glyphicon-user"></span></div>
                        <input type="text" class="ticket_input" autocomplete="new-password" placeholder="请输入账号" name="username" id="username1">
                    </div>
                </div>
                <div class="form-group" style="padding: 0 30px;">
                    <div class="input-group">
                        <div class="input-group-addon ticket_input_addon"><span class="glyphicon glyphicon-lock"></span></div>
                        <input type="password" class="ticket_input" autocomplete="new-password" placeholder="请输入密码" name="password" id="password1">
                    </div>
                </div>
                <button type="submit" class="btn btn-lg green btn-login">登  录</button>
            </form>
        </div>
    </div>

    <!-- 找回密码模态框（Modal） -->
    <div class="modal fade" id="myback" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">账号找回</h4>
          </div>
          <div class="modal-body">
            <div justified="true" class="tab-container">
              <ul class="nav nav-tabs nav-justified">
                <li id="one"><a href="#">安全验证</a></li>
                <li id="two"><a href="#">重置密码</a></li>
              </ul>
              <div class="tab-content">
                <form action="javascript:;" class="back-form" method="post">
                  <div id="one" class="tab-pane" tab-content-transclude="tab">
                    <div class="form-group col-lg-12 mt10">
                      <label class="col-lg-3 text-right l_h_34">账号:</label>
                      <div class="col-lg-6">
                        <input type="text" class="form-control" id="loginname" name="loginname" placeholder="用户名/手机" required>
                      </div>
                      <button id="send" class="btn btn-info sendBtn"></button>
                    </div>
                    <div class="form-group col-lg-12">
                      <label class="col-lg-3 text-right l_h_34">验证码:</label>
                      <div class="col-lg-5">
                        <input type="text" class="form-control" id="verification" name="verification" placeholder="验证码">
                      </div>
                    </div>
                    <div class="form-group col-lg-12 red">
                      <i class="col-lg-11 col-lg-offset-1">小贴士:  已绑定手机的账号可使用此方式，未绑定手机请用其他方式找回</i>
                    </div>
                  </div>
                  <div id="two" class="tab-pane" tab-content-transclude="tab">
                    <div class="form-group col-lg-12 mt10">
                      <label class="col-lg-3 text-right l_h_34">新密码:</label>
                      <div class="col-lg-6">
                        <input type="password" class="form-control" id="backpassword" name="backpassword">
                      </div>
                    </div>
                    <div class="form-group col-lg-12">
                      <label class="col-lg-3 text-right l_h_34">确认密码:</label>
                      <div class="col-lg-6">
                        <input type="password" class="form-control" id="repassword" name="repassword">
                      </div>
                    </div>
                  </div>
                </form>
              </div>
            </div>
            
            <div id="back_success">
              <h2 align="center">密码重置成功</h2>
            </div>
          </div>
          <div class="modal-footer">
            <button class="btn btn-info" id="nextStep">下一步</button>
            <button class="btn btn-success" id="lastStep">确认</button>
            <button class="btn btn-danger" id="closeModal" data-dismiss="modal" aria-hidden="true">关闭</button>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 注册模态框（Modal） -->
    <div class="modal fade" id="myregister" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">注册</h4>
          </div>
          <div class="modal-body">
            <form action="javascript:;" id="register-form" class="register-form" method="post">
              <div class="form-group col-lg-12">
                <label class="col-lg-3 text-right l_h_34"><b class="red">*</b> 企业名称：</label>
                <div class="col-lg-6 nomargin">
                  <input type="text" class="form-control" id="company_name" name="company_name">
                </div>
              </div>
              <div class="form-group col-lg-12">
                <label class="col-lg-3 text-right l_h_34"><b class="red">*</b> 登录密码：</label>
                <div class="col-lg-6 nomargin">
                  <input type="password" class="form-control" id="regpassword" name="regpassword">
                </div>
              </div>
              <div class="form-group col-lg-12">
                <label class="col-lg-3 text-right l_h_34"><b class="red">*</b> 确认密码：</label>
                <div class="col-lg-6 nomargin">
                  <input type="password" class="form-control" id="regpasswordc" name="regpasswordc">
                </div>
              </div>
              <div class="form-group col-lg-12">
                <label class="col-lg-3 text-right l_h_34"><b class="red">*</b> 联系电话：</label>
                <div class="col-lg-6 nomargin">
                  <input type="text" class="form-control" id="mobile" name="mobile">
                </div>
              </div>
              <div class="form-group col-lg-12">
                <label class="col-lg-3 text-right l_h_34">负责人：</label>
                <div class="col-lg-6 nomargin">
                  <input type="text" class="form-control" id="master" name="master">
                </div>
              </div>
              <div class="form-group col-lg-12">
                <label class="col-lg-3 text-right l_h_34">地址：</label>
                <div class="col-lg-6 nomargin">
                  <input type="text" class="form-control" id="address" name="address">
                </div>
              </div>
              <div class="form-group step-2">
                <label class="col-lg-3 text-right l_h_34">验证码</label>
                <div class="col-lg-6 input-group" style="padding-left: 8px;">
                    <input type="text" class="form-control" id="code_input" style="width: 55%" placeholder="验证码">
                    <img id="v_container" style="cursor:pointer;width: 42%; height: 34px; padding: 0px; margin: 0px; border-width: 0px;" />
                </div>
              </div>
              <div class="form-group col-lg-12">
                <label class="col-lg-3 text-right l_h_34">营业执照：</label>
                <div class="col-lg-6 nomargin">
                  <input type="file" name="upload_file" id="upload_file" accept="image/*">
                  <br/><img src="" id="img0" width="200px" height="150px" class="hide">
                </div>
              </div>
            </form>
          </div>
          <div class="modal-footer">
            <button class="btn btn-success" id="registerOffice">完成注册</button>
          </div>
        </div>
      </div>
    </div>
    
<!-- END : LOGIN PAGE 5-1 -->


<script type="text/javascript">

    "use strict";
    var hostname = '';

    var Login = function() {

        var handleLogin = function() {

            $('.login-form').validate({
                errorElement: 'span', //default input error message container
                errorClass: 'help-block', // default input error message class
                focusInvalid: false, // do not focus the last invalid input
                rules: {
                    username: {
                        required: true
                    },
                    password: {
                        required: true
                    },
                    remember: {
                        required: false
                    }
                },

                messages: {
                    username: {
                        required: "Username is required."
                    },
                    password: {
                        required: "Password is required."
                    }
                },

                invalidHandler: function(event, validator) { //display error alert on form submit   
                    $('.alert-danger', $('.login-form')).show();
                },

                highlight: function(element) { // hightlight error inputs
                    $(element).closest('.form-group').addClass('has-error'); // set error class to the control group
                },

                success: function(label) {
                    label.closest('.form-group').removeClass('has-error');
                    label.remove();
                },

                errorPlacement: function(error, element) {
                    error.insertAfter(element.closest('.input-icon'));
                },

                submitHandler: function(form) {
                    var username = $('#username').val();
                    var password = $('#password').val();
                    if(hostname.indexOf('localhost') == 0){
                        username = $('#username1').val();
                        password = $('#password1').val();
                    }
                    $.ajax({
                        'url' : "http://tsvtest.tripln.top/login.html",
                        'type':'POST',
                        'data':{
                            'username' : username,
                            'password' : password,
                        },
                        'dataType' : 'json',
                        'success':function(data,textStatus,jqXHR){
                            if(data.errcode === 0){
                                location.href = '/';
                            }else{
                                alert(data.errmsg);
                            }
                        },
                    });
                    //form.submit(); // form validation success, call ajax form submit
                }
            });

            $('.login-form input').keypress(function(e) {
                if (e.which == 13) {
                    if ($('.login-form').validate().form()) {
                        $('.login-form').submit(); //form validation success, call ajax form submit
                    }
                    return false;
                }
            });

            $('#forget-password').click(function(){
                $('#myback').modal();
            });

            $('#register').click(function(){
                $('#myregister').modal();
            });
        }

        var handleForget = function() {
            var key,timer = {};
            var sendBtn = $('#send');
            //8到16位数字与字母组合
            jQuery.validator.addMethod('checkpassword', function(value, element){
                var qwe = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
                return this.optional(element) || qwe.test(value);    
            }, '');
            //change tab which tabNum given
            var changeTab = function(tabNum) {
                $('.tab-container ul li').removeClass('active');
                $('.tab-content .back-form .tab-pane').css('display','none');
                $('.tab-container ul #' + tabNum).addClass('active');
                $('.tab-content .back-form #' + tabNum).css('display','');
            };

            //send message code 
            var sendVerificationCode = function(loginname) {
                $.ajax({
                    url : '/api/uc/sc/loginService/sendCode',
                    type: 'POST',
                    data: JSON.stringify({'loginname': loginname}),
                    contentType: 'application/json;charset=utf-8',
                    dataType : 'json',
                    success: function(data,textStatus,jqXHR){
                        if(data.errcode === 0){
                            key = data.data;
                        } else {
                            alert(data.errmsg);
                        }
                    }
                });
            };

            //click nextStep to validate VerificationCode
            $('#nextStep').click(function(){
                var loginname = $('#loginname');
                var verification = $('#verification');
                if(validate.element(loginname) && validate.element(verification)){
                    var para = {
                        'key': key,
                        'code': verification.val()
                    }
                    $.ajax({
                        url : '/api/uc/sc/loginService/validateCode',
                        type: 'POST',
                        data: JSON.stringify(para),
                        contentType: 'application/json;charset=utf-8',
                        dataType : 'json',
                        success: function(data,textStatus,jqXHR){
                            if(data.errcode === 0){
                                changeTab('two');
                                $('#nextStep').hide();
                                $('#lastStep').show();
                            }else{
                                alert(data.errmsg);
                            }
                        }
                    });
                }
            });

            //Interval for send verification code
            $('#send').click(function(){
                var loginname = $('#loginname');
                if(validate.element(loginname)){
                    timer.timeout = 19;
                    sendBtn.attr('disabled', true);
                    sendBtn.text(timer.timeout + 1 + '(s)');
                    sendVerificationCode(loginname.val());
                    timer.interval = window.setInterval(function(){
                        sendBtn.text(timer.timeout + '(s)');
                        timer.timeout -= 1;
                        if(timer.timeout < -1){
                            window.clearInterval(timer.interval);
                            sendBtn.text('发送验证码');
                            sendBtn.attr('disabled', false);
                        }
                    }, 1000);
                }
            });

            $('#lastStep').click(function(){
                var backpassword = $('#backpassword');
                var repassword = $('#repassword');
                if(validate.element(backpassword) && validate.element(repassword)){
                    var para = {
                        'key': key,
                        'password': backpassword.val(),
                        'repassword': repassword.val()
                    };
                    $.ajax({
                        url : '/api/uc/sc/loginService/updatePwd',
                        type: 'POST',
                        data: JSON.stringify(para),
                        contentType: 'application/json;charset=utf-8',
                        dataType : 'json',
                        success: function(data,textStatus,jqXHR){
                            if(data.errcode === 0){
                                $('.tab-container').hide();
                                $('#lastStep').hide();
                                $('#back_success').show();
                                $('#closeModal').show();
                            } else {
                                alert(data.errmsg);
                            }
                        },
                    });
                }
            });
            
            var validate = $('.back-form').validate({
                onsubmit: false,
                errorClass: 'col-lg-3 wrong l_h_34 red',
                errorElement: 'label',
                errorPlacement: function(error, element) {
                    if(error.html()){
                        error.appendTo(element.parent().parent());
                    }
                },
                rules: {
                    loginname: 'required',
                    verification: 'required',
                    backpassword: {
                        required: true,
                        minlength: 8,
                        maxlength: 16,
                        checkpassword: true
                    },
                    repassword: {
                        required: true,
                        equalTo: "#backpassword"
                    }
                },
                messages: {
                    loginname: '',
                    verification: '',
                    backpassword: {
                        required: '必填',
                        minlength: '最小长度为8',
                        maxlength: '最大长度为16',
                        checkpassword: '需包含字母和数字'
                    },
                    repassword: {
                        required: '必填',
                        equalTo: '两次密码不一致'
                    }
                },
                submitHandler: function() {
                    //other submit type. so it's empty
                }
            });

            //init parameters when open modal
            $('#myback').on('show.bs.modal', function() {
                $('#loginname').val('');
                $('#verification').val('');
                $('#backpassword').val('');
                $('#repassword').val('');
                changeTab('one');
                $('#nextStep').show();
                $('#lastStep').hide();
                $('#closeModal').hide();
                $('#back_success').hide();
                sendBtn.text('发送验证码');
                sendBtn.attr('disabled', false);
            });

            //clear interval while modal hide
            $('#myback').on('hide.bs.modal', function() {
                validate.resetForm();
                window.clearInterval(timer.interval);
            });
        }

        var handleRegister = function() {
            var imgurl = null, picKey = null;

            //检测手机号是否正确  
            jQuery.validator.addMethod('checkMobile', function(value, element){
                return this.optional(element) || (value.length == 11 && /^1[3|5|7|8|9]\d{9}$/.test(value));    
            }, '');
            //8到16位数字与字母组合
            jQuery.validator.addMethod('checkpassword', function(value, element){
                var qwe = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
                return this.optional(element) || qwe.test(value);    
            }, '');

            var validate = $('.register-form').validate({
                onsubmit: false,
                errorClass: 'col-lg-3 wrong l_h_34 red',
                errorElement: 'label',
                errorPlacement: function(error, element) {
                    if(error.html()){
                        error.appendTo(element.parent().parent());
                    }
                },
                rules: {
                    company_name: 'required',
                    mobile: {
                        required: true,
                        checkMobile: true
                    },
                    regpassword: {
                        required: true,
                        minlength: 8,
                        maxlength: 16,
                        checkpassword: true
                    },
                    regpasswordc: {
                        required: true,
                        equalTo: "#regpassword"
                    }
                },
                messages: {
                    company_name: '必填',
                    mobile: {
                        required: '必填',
                        checkMobile: '手机格式不正确'
                    },
                    regpassword: {
                        required: '必填',
                        minlength: '最小长度为8',
                        maxlength: '最大长度为16',
                        checkpassword: '需包含字母和数字'
                    },
                    regpasswordc: {
                        required: '必填',
                        equalTo: '两次密码不一致'
                    }
                },
                submitHandler: function() {
                    //other submit type. so it's empty
                }
            });

            //Interval for send verification code
            $('#registerOffice').click(function(){
                if(validate.element(company_name) && validate.element(regpassword)
                 && validate.element(regpasswordc) && validate.element(mobile)){
                    var para = {
                        'name': $('#company_name').val(),
                        'regpassword': $('#regpassword').val(),
                        'regpasswordc': $('#regpasswordc').val(),
                        'master': $('#master').val(),
                        'mobile': $('#mobile').val(),
                        'address': $('#address').val(),
                        'license_img': imgurl,
                        'picKey': picKey,
                        'picCode': $('#code_input').val()
                    }
                    $.ajax({
                        url : '/api/uc/sc/office/addForRegister',
                        type: 'POST',
                        data: JSON.stringify(para),
                        contentType: 'application/json;charset=utf-8',
                        dataType : 'json',
                        success: function(data, textStatus, jqXHR){
                            if(data.errcode === 0){
                                alert('注册成功，您的账号为：' + data.data.msg + '可使用手机号登录。');
                                $('#myregister').modal('hide');
                            } else {
                                alert(data.errmsg);
                            }
                        },
                    });
                }
            });

            //上传图片到服务器
            $("#upload_file").change(function(){
                var objUrl = getObjectURL(this.files[0]);
                if (objUrl) {
                    $("#img0").attr("src", objUrl);
                    $("#img0").removeClass("hide");
                }
                var formData = new FormData();
                formData.append("file", this.files[0]);
                $.ajax({
                    url : 'https://txy.juyouhx.com/Api/Api/ObjectToOss?topdir=aa&selfdir=bb',
                    type: 'POST',
                    data: formData,
                    async: false,
                    processData: false,
                    contentType: false,
                    success: function(data){
                        if(data.state == 1){
                            imgurl = data.savename;
                        }
                    }
                });
            });

            //建立一個可存取到該file的url
            function getObjectURL(file) {
                var url = null;
                if (window.createObjectURL != undefined) { // basic
                    url = window.createObjectURL(file);
                } else if (window.URL != undefined) { // mozilla(firefox)
                    url = window.URL.createObjectURL(file);
                } else if (window.webkitURL != undefined) { // webkit or chrome
                    url = window.webkitURL.createObjectURL(file);
                }
                return url;
            }

            //获取图形验证码
            function getCodePic() {
                $.ajax({
                    url: "/api/uc/sc/loginService/getCodePic",
                    type: 'get',
                    success: function (data, textStatus, jqXHR){
                        if (data.errcode === 0) {
                            picKey = data.data.key;
                            $('#v_container')[0].src = data.data.pic;
                        } else {
                            alert('获取图形验证码失败');
                        }
                    }
                });
            }

            //点击验证码图片重新加载
            $("#v_container").bind('click', function () {
                getCodePic();
            });

            //init parameters when open modal
            $('#myregister').on('show.bs.modal', function() {
                $('#company_name').val('');
                $('#regpassword').val('');
                $('#regpasswordc').val('');
                $('#master').val('');
                $('#mobile').val('');
                $('#address').val('');
                $('#email').val('');
                $('#upload_file').val('');
                $('#code_input').val('');
                $('#img0').attr('src', '');
                $("#img0").addClass("hide");
                getCodePic();
            });

            //clear interval while modal hide
            $('#myregister').on('hide.bs.modal', function() {
                validate.resetForm();
            });

        }

        return {
            //main function to initiate the module
            init: function() {
                handleLogin();
                handleForget();
                handleRegister();
            }
        };
    }();

    jQuery(document).ready(function() {
        Login.init();
        hostname = window.location.hostname;
        // console.log(hostname)
        $(".user-login-5").css("width", $(document.body).width())
        $(".user-login-5").css("height", $(window).height())
        if(hostname.indexOf('localhost') == 0){
            $(".user-login-5").css("background-image","url(./app/00pageframework/img/ticket_back.jpg)");
            $(".user-login-5").css("background-size","100% 100%");
            $('.information_html').hide();
            $('.ticket_html').show();
            $('.tsv_html').hide();
        } else if(hostname.indexOf('hldwt') == 0){
            $('.tsv_html').show();
            $('.information_html').hide();
            $('.skcy').hide();
            $('.syzhly').hide();
            $('.sst').hide();
            $('.hldwt').show();
        } else if(hostname.indexOf('sywt') == 0){
            $('.tsv_html').show();
            $('.information_html').hide();
            $('.skcy').hide();
            $('.hldwt').hide();
            $('.sst').hide();
            $('.syzhly').show();
        } else if(hostname.indexOf('sst.scpyun') == 0){
            $('.tsv_html').show();
            $('.information_html').hide();
            $('.skcy').hide();
            $('.hldwt').hide();
            $('.syzhly').hide();
            $('.sst').show();
        } else {
            $('.tsv_html').show();
            $('.information_html').hide();
            $('.skcy').show();
            $('.syzhly').hide();
            $('.sst').hide();
            $('.hldwt').hide();
        }
    });

</script>      
</body>

</html>